package net.mysoft.budgetsoft.system.action;

import java.util.List;

import javax.annotation.Resource;

import net.mysoft.budgetsoft.system.pagemodel.DictionaryDetail;
import net.mysoft.budgetsoft.system.service.DictionaryDetailService;
import net.mysoft.framework.base.BaseAction;
import net.mysoft.framework.model.Json;
import net.mysoft.framework.util.ExceptionUtil;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;

import com.opensymphony.xwork2.ModelDriven;


@Action(value = "dictionaryDetailAction")
public class DictionaryDetailAction  extends BaseAction implements ModelDriven<DictionaryDetail>{

	private static final Logger logger = Logger.getLogger(DictionaryDetailAction.class);

	private DictionaryDetail dictionaryDetail = new DictionaryDetail();
	@Resource
	private DictionaryDetailService dictionaryDetailService;

	public DictionaryDetail getDictionaryDetail() {
		return dictionaryDetail;
	}

	public void setDictionaryDetail(DictionaryDetail dictionaryDetail) {
		this.dictionaryDetail = dictionaryDetail;
	}

	@Override
	public DictionaryDetail getModel() {
		return dictionaryDetail;
	}

	public DictionaryDetailService getDictionaryDetailService() {
		return dictionaryDetailService;
	}

	public void setDictionaryDetailService(
			DictionaryDetailService dictionaryDetailService) {
		this.dictionaryDetailService = dictionaryDetailService;
	}

	/**
	 * 列表
	 */
	public void findDetailByType() {
		Json j = new Json();
		try {
			List<DictionaryDetail> oList=dictionaryDetailService.find(dictionaryDetail);
			j.setSuccess(true);
			j.setMsg("删除成功！");
			j.setObj(oList);
		} catch (Exception e) {
			logger.error(ExceptionUtil.getExceptionMessage(e));
			j.setMsg("删除失败！");
		}
		super.writeJson(j);
	}
	
	
}


